feat(playwright): integrate campaign preview tests into e2e suite and… - #720
feat(playwright): integrate campaign preview tests into e2e suite and…#720cmullenx wants to merge 5 commits into
Conversation
… add coverage Wire campaign preview Playwright tests into the contact center e2e runner and add 9 new tests covering previously untested component behavior. Infrastructure: - constants.ts: add CAMPAIGN_TEST_IDS with all 21 data-testid values from the CampaignTask component tree (task, list item, title, phone, actions, buttons, expanded area, popover, countdown, global variables, error dialog) - test-manager.ts: add setupForCampaignPreview() — single agent, desktop login, console logging (campaign tests inject mock tasks via page.evaluate) - test-data.ts: add SET_10 with TEST_SUITE pointing to campaign-preview-tests.spec.ts so playwright.config.ts auto-discovers it Utility enhancement: - campaignPreviewUtils.ts: extend stubCampaignPreviewActions to support 'cancel' failAction (stubs task.end() to reject), add cancel tracking to getCampaignActionCounts return type New test coverage (9 tests across 6 describe blocks): - Cancel Error: cancel failure shows error dialog with correct title, dismiss re-enables cancel button - Button Disabled Combinations: both skip and remove disabled simultaneously, accept remains enabled - Countdown Display: countdown timer renders when timeout timestamp is set - Fallback Title: empty customer name falls back to ANI as title, phone subtitle hidden when it equals the title - Error Dialog Content: verifies correct error title text for accept, skip, and remove failures (3 tests) - Re-offer After Skip: simulated new contact (changed timeout) resets all buttons to enabled state Total campaign preview test count: 22 existing + 9 new = 31 tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a51b79c540
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6435cc252
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc6b4e8d4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| CHAT_URL: `${env.PW_CHAT_URL}-e2e-10.html`, | ||
| EMAIL_ENTRY_POINT: `${env.PW_SANDBOX}.e2e10@gmail.com`, | ||
| ENTRY_POINT: env.PW_ENTRY_POINT10, | ||
| TEST_SUITE: 'campaign-preview-tests.spec.ts', |
There was a problem hiding this comment.
Document the newly activated Playwright set
Adding SET_10 activates a new suite and also introduces a setup flow, shared helpers, constants, and stability constraints, but the commit updates no Playwright standing documentation. The routed Playwright guidance explicitly makes documentation alignment mandatory for changes to suites, sets, or setup flows; update the current Playwright architecture/baseline documentation in this same change so the documented suite-to-set mapping and cleanup behavior remain authoritative.
AGENTS.md reference: AGENTS.md:L68-L68
Useful? React with 👍 / 👎.
…d of prototype refreshTaskList is a bound class field (own property), not a prototype method. The previous restoreRefreshTaskList read from the prototype where it was always undefined, making the restore a silent no-op. Now stubRefreshTaskList saves the original on window before overwriting, and restoreRefreshTaskList restores from that saved reference.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ddc155e93
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // The inline card uses timerDisplayMode=handle-time, so countdown only appears in popover. | ||
| // Check the campaign-countdown element directly | ||
| const countdown = testManager.agent1Page.getByTestId(CAMPAIGN_TEST_IDS.COUNTDOWN).first(); | ||
| await expect(countdown).toBeAttached({timeout: 5000}); |
There was a problem hiding this comment.
Open the popover before checking the countdown
This assertion only checks DOM attachment even though the countdown is rendered inside a popover configured to open on mouseenter. Without hovering the campaign task, the test passes while the countdown remains hidden, so regressions that prevent users from seeing it are not detected. Hover the trigger and assert that the countdown is visible, ideally also checking its displayed value.
Useful? React with 👍 / 👎.
COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7836
This pull request addresses
Adds e2e tests for campaigns
by making the following changes
adding e2e tests and integrating them into the suite
i have run the code review here: https://agenticai-quality-assurance.cisco.com/scan/f7644d83bbb6800c/report.html?t=sXGlRWod0B1DSr7-fiKfpsCuZoiwiJkPpv29GIECytg&exp=1786990434903&u=Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNDUxZGQ0Ni01NjJjLTQyOGUtYTA5OC02MzNkMTFlZDdmNGE
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.